package org.stone.project;

import reactor.core.publisher.Flux;

public class DeafultMethodTest {
    public static void main(String[] args) throws InterruptedException {
        Flux.just("1","2","3","4","5","6","7","8","9")
                .map(e->{
                    System.out.println(e);
                    if (e.equals("5"))
                        throw new IllegalArgumentException("参数异常");
                    return e;
                })
                .doOnNext(e->{
                    System.out.println("下一个");
                })
                .doOnError(e->{
                    System.out.println("消费失败");
                })
                .doOnComplete(()->{
                    System.out.println("that is all");
                })
                .subscribe();


        Thread.currentThread().join();
    }
}
